import { request } from '@/service/index'


export const login = (code: any) => {
  return request<string>({
    url: `/dailyNote/api/login/${code}`,
    method: 'GET'
  })
}


export const updateInfo = (params: {
  "avatar": string,
  "name": string,
}) => {
  return request<API.LOGIN>({
    url: '/dailyNote/api/login/uploadAvatarName',
    method: 'POST',
    params
  })
}

export const getMyDiaryStatistics = () => {
  return request<API.Response<{count: string, JiaziCycle: string}>>({
    url: `/dailyNote/api/diary/getMyDiaryStatistics`,
    method: 'GET',
  })
}


export const updateUserInfo = (params: API.USER_INFO) => {
  return request<API.Response<string>>({
    url: `/dailyNote/api/login/uploadUserInfo`,
    method: 'POST',
    params
  })
}

export const getUserInfo = () => {
  return request<API.Response<any>>({
    url: `/dailyNote/api/login/getUserInfo`,
    method: 'GET'
  })
}
